//
// Created by dong on 2025/10/21.
//

#ifndef SDL_DRAW_TOOLS_BUTTON_H
#define SDL_DRAW_TOOLS_BUTTON_H
#include "Global.h"
class Button
{
public:
    enum ButtonType{Menu,ColorTool};
    Button(SDL_Rect rect,string str="",SDL_Color color={0});

public:
    SDL_Color getColor()const;
    void setColor(const SDL_Color& color);
    SDL_Rect getRect()const;
    string getName()const;
    bool contains(int x,int y);

public:
    bool mousePressEvent(SDL_Event* msg);
    void render(SDL_Renderer* render,ButtonType type);

protected:
    SDL_Rect m_rect;
    SDL_Color color;
    string m_name;
    bool isFocus;
    bool isClicked;
};

#endif //SDL_DRAW_TOOLS_BUTTON_H